package com.visionet.school.app.web.entity.enums;

/**
 * Created by hxpeng on 2017/3/30.
 */
public enum FileEnums {

    VIDEO("video","视频"),
    AUDIO("audio","音频"),
    TEXT("text","文本"),
    IMG("img","图片"),
    SUCCESS("success","下载成功"),
    FAILED("failed","下载失败");

    private String key;
    private String value;

    FileEnums(String key, String value){
        this.key = key;
        this.value = value;
    }

    public static FileEnums fromCode(String key){
        for (FileEnums type : values()){
            if(type.key.equalsIgnoreCase(key)){
                return type;
            }
        }
        return null;
    }

    public String toKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
